package com.yitongmao.activity;

import android.app.Dialog;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.google.gson.Gson;
import com.yitongmao.AppConstancts;
import com.yitongmao.bean.CanCleIntentBean;
import com.yitongmao.bean.LoginHuancunBean;
import com.yitongmao.bean.OrderDetailsBean;
import com.yitongmao.common.CallBackListener;
import com.yitongmao.core.cache.ACache;
import com.yitongmao.core.network.service.BaseService;
import com.yitongmao.util.SignUtil;
import com.yitongmao.util.ToastUtils;
import com.yitongmao.yitmfruit.R;
import com.zhy.autolayout.AutoLinearLayout;

import java.util.Map;
import java.util.Random;
import java.util.TreeMap;

import butterknife.Bind;
import butterknife.ButterKnife;

public class OrderDetailsActivity extends AppCompatActivity {
    @Bind(R.id.maddressName)
    TextView maddressName;
    @Bind(R.id.maddressPhone)
    TextView maddressPhone;
    @Bind(R.id.maddressDetails)
    TextView maddressDetails;
    @Bind(R.id.mDetailsImage)
    ImageView mDetailsImage;
    @Bind(R.id.mDetailsTitle)
    TextView mDetailsTitle;
    @Bind(R.id.mDetailsPrice)
    TextView mDetailsPrice;
    @Bind(R.id.mDetailsDanHao)
    TextView mDetailsDanHao;
    @Bind(R.id.mDetailsDownTime)
    TextView mDetailsDownTime;
    @Bind(R.id.mDetailsPayLeiXing)
    TextView mDetailsPayLeiXing;
    @Bind(R.id.mDetailsPayWay)
    TextView mDetailsPayWay;
    @Bind(R.id.mDetailsHuMing)
    TextView mDetailsHuMing;
    @Bind(R.id.mDetailsZhangHao)
    TextView mDetailsZhangHao;
    @Bind(R.id.mDetailsOpenHu)
    TextView mDetailsOpenHu;
    @Bind(R.id.mDetailsLianHangHao)
    TextView mDetailsLianHangHao;
    @Bind(R.id.mDetailsShiBieMa)
    TextView mDetailsShiBieMa;
    @Bind(R.id.mDetailsPeiSongWay)
    TextView mDetailsPeiSongWay;
    @Bind(R.id.mDetailsTaiTouLeiXing)
    TextView mDetailsTaiTouLeiXing;
    @Bind(R.id.mDetailsTaiTouMingCheng)
    TextView mDetailsTaiTouMingCheng;
    @Bind(R.id.mDetailsPayPrice)
    TextView mDetailsPayPrice;
    @Bind(R.id.btn_back)
    Button btnBack;
    @Bind(R.id.mOrderdaifahuo)
    ImageView mOrderdaifahuo;
    @Bind(R.id.mOrderdaishouhuo)
    ImageView mOrderdaishouhuo;
    @Bind(R.id.mOrderyiwancheng)
    ImageView mOrderyiwancheng;
    @Bind(R.id.mQuxiaodingdan)
    Button mQuxiaodingdan;
    @Bind(R.id.mGoPay)
    Button mGoPay;
    @Bind(R.id.mShenQingTuiKuan)
    Button mShenQingTuiKuan;
    @Bind(R.id.mOrderdaifukuan)
    ImageView mOrderdaifukuan;
    @Bind(R.id.activity_order_details)
    AutoLinearLayout activityOrderDetails;
    @Bind(R.id.mOrderNum1)
    TextView mOrderNum1;
    @Bind(R.id.mOrderSumPrice)
    TextView mOrderSumPrice;
    private String orderCode;
    private Dialog bottomDialog;
    private AutoLinearLayout mShoppingNotDelivery;
    private AutoLinearLayout mCaoZuoYouWu;
    private AutoLinearLayout mChongFu;
    private AutoLinearLayout qiTa;
    private AutoLinearLayout mBuXiangMai;
    private AutoLinearLayout qiTaYuanYin;
    private CheckBox mCheckhoppingNotDelivery;
    private CheckBox mCheckCaoZuoYouWu;
    private CheckBox mCheckChongFu;
    private CheckBox mCheckQiTa;
    private CheckBox mCheckBuXiangMai;
    private CheckBox mCheckQiTaYuanYin;
    private TextView mNotSD;
    private TextView mCZYW;
    private TextView mCfxd;
    private TextView mQTPY;
    private TextView mbxm;
    private TextView mQTYY;
    private Button submit;
    private LoginHuancunBean loginHuancunBean;
    private int loginId1;
    private int yuanyinNum = 1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        immerSion();
        setContentView(R.layout.activity_order_details);
        ButterKnife.bind(this);
        initView();
    }

    private void initView() {
        Gson gson = new Gson();
        //解析查找的缓存并判断
        String loginId = ACache.get(OrderDetailsActivity.this).getAsString("loginId");
        if (loginId != null) {
            loginHuancunBean = gson.fromJson(loginId, LoginHuancunBean.class);
            loginId1 = loginHuancunBean.userInfo.loginId;
        }
        btnBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                OrderDetailsActivity.this.finish();
            }
        });
        String orderdetails = ACache.get(OrderDetailsActivity.this).getAsString("orderdetails");
        final OrderDetailsBean orderDetailsBean = gson.fromJson(orderdetails, OrderDetailsBean.class);

        mShenQingTuiKuan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(OrderDetailsActivity.this, ApplyForRefundActivity.class);
                intent.putExtra("orderCode",orderDetailsBean.dateilMap.get(0).orderCode);
                startActivity(intent);
            }
        });
        mQuxiaodingdan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                orderCode = orderDetailsBean.dateilMap.get(0).orderCode;
                shoppingCloseAnAccount();
                diaLog();
            }
        });
        mGoPay.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(OrderDetailsActivity.this, GoPayActivity.class);
                startActivity(intent);
            }
        });
        //:00-待付款
        if (orderDetailsBean.dateilMap.get(0).state.equals("00")) {
            mOrderdaifukuan.setVisibility(View.VISIBLE);
            mOrderdaifahuo.setVisibility(View.GONE);
            mOrderdaishouhuo.setVisibility(View.GONE);
            mOrderyiwancheng.setVisibility(View.GONE);
            mQuxiaodingdan.setVisibility(View.VISIBLE);
            mGoPay.setVisibility(View.VISIBLE);
            mShenQingTuiKuan.setVisibility(View.GONE);
        }
        String orderdetails2 = ACache.get(OrderDetailsActivity.this).getAsString("orderdetails");
        OrderDetailsBean orderDetailsBean2 = gson.fromJson(orderdetails2, OrderDetailsBean.class);

        // 02-待发货
        if (orderDetailsBean2.dateilMap.get(0).state.equals("02")) {
            mOrderdaifukuan.setVisibility(View.GONE);
            mOrderdaifahuo.setVisibility(View.VISIBLE);
            mOrderdaishouhuo.setVisibility(View.GONE);
            mOrderyiwancheng.setVisibility(View.GONE);
            mQuxiaodingdan.setVisibility(View.GONE);
            mGoPay.setVisibility(View.GONE);
            mShenQingTuiKuan.setVisibility(View.VISIBLE);
        }
        String orderdetails3 = ACache.get(OrderDetailsActivity.this).getAsString("orderdetails");
        OrderDetailsBean orderDetailsBean3 = gson.fromJson(orderdetails3, OrderDetailsBean.class);
        //03-待收货
        if (orderDetailsBean3.dateilMap.get(0).state.equals("03")) {
            mOrderdaifukuan.setVisibility(View.GONE);
            mOrderdaifahuo.setVisibility(View.VISIBLE);
            mOrderdaishouhuo.setVisibility(View.VISIBLE);
            mOrderyiwancheng.setVisibility(View.GONE);
            mQuxiaodingdan.setVisibility(View.GONE);
            mGoPay.setVisibility(View.GONE);
            mShenQingTuiKuan.setVisibility(View.VISIBLE);
        }
        String orderdetails4 = ACache.get(OrderDetailsActivity.this).getAsString("orderdetails");
        OrderDetailsBean orderDetailsBean4 = gson.fromJson(orderdetails4, OrderDetailsBean.class);
        //; 04-已完成
        if (orderDetailsBean4.dateilMap.get(0).state.equals("04")) {
            mOrderdaifukuan.setVisibility(View.GONE);
            mOrderdaifahuo.setVisibility(View.GONE);
            mOrderdaishouhuo.setVisibility(View.GONE);
            mOrderyiwancheng.setVisibility(View.VISIBLE);

            mQuxiaodingdan.setVisibility(View.GONE);
            mGoPay.setVisibility(View.GONE);
            mShenQingTuiKuan.setVisibility(View.GONE);
        }

        if (orderDetailsBean != null) {
            String provinceName = orderDetailsBean.dateilMap.get(0).address.provinceName;
            String cityName = orderDetailsBean.dateilMap.get(0).address.cityName;
            String countryName = orderDetailsBean.dateilMap.get(0).address.countryName;
            String name = orderDetailsBean.dateilMap.get(0).address.name;
            String phone = orderDetailsBean.dateilMap.get(0).address.phone;
            String detailsimage = orderDetailsBean.dateilMap.get(0).orderGood.get(0).goodsThumb;
            String title = orderDetailsBean.dateilMap.get(0).orderGood.get(0).title;
            double tradePrice = orderDetailsBean.dateilMap.get(0).orderGood.get(0).tradePrice;
            int number = orderDetailsBean.dateilMap.get(0).orderGood.get(0).number;
            double v = tradePrice * number;
            String orderCode = String.valueOf(orderDetailsBean.dateilMap.get(0).orderCode);
            String createTime = String.valueOf(orderDetailsBean.dateilMap.get(0).createTime);
            String payType = String.valueOf(orderDetailsBean.dateilMap.get(0).payType);
            String companyName = String.valueOf(orderDetailsBean.dateilMap.get(0).account.companyName);
            String account = String.valueOf(orderDetailsBean.dateilMap.get(0).account.account);
            String openingBank = String.valueOf(orderDetailsBean.dateilMap.get(0).account.openingBank);
            String unionLine = String.valueOf(orderDetailsBean.dateilMap.get(0).account.unionLine);
            String remittanceCode = String.valueOf(orderDetailsBean.dateilMap.get(0).remittanceCode);
            maddressName.setText(name);
            maddressPhone.setText(phone);
            maddressDetails.setText(provinceName + "" + cityName + "" + countryName);
            Glide.with(OrderDetailsActivity.this).load(detailsimage).into(mDetailsImage);
            mDetailsTitle.setText(title);
            mDetailsPrice.setText("￥" + tradePrice + "万/吨");
            mDetailsDanHao.setText(orderCode);
            mDetailsDownTime.setText(createTime);
            mDetailsPayLeiXing.setText(payType);
            mDetailsHuMing.setText(companyName);
            mDetailsZhangHao.setText(account);
            mDetailsOpenHu.setText(openingBank);
            mDetailsLianHangHao.setText(unionLine + "（非必填）");
            mDetailsShiBieMa.setText(remittanceCode);
            mOrderNum1.setText("X" + number);
            mDetailsPayPrice.setText("￥" + v + "元");
            mOrderSumPrice.setText("￥" + v + "元");
        }
    }

    private void diaLog() {
        bottomDialog = new Dialog(OrderDetailsActivity.this, R.style.BottomDialog);
        View contentView = LayoutInflater.from(OrderDetailsActivity.this).inflate(R.layout.alert_dialog3, null);

        //点击屏幕外边消失dialog
        contentView.findViewById(R.id.lala).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                bottomDialog.dismiss();
            }
        });
        mShoppingNotDelivery = (AutoLinearLayout) contentView.findViewById(R.id.mShoppingNotDelivery);
        mCaoZuoYouWu = (AutoLinearLayout) contentView.findViewById(R.id.mCaoZuoYouWu);
        mChongFu = (AutoLinearLayout) contentView.findViewById(R.id.mChongFu);
        qiTa = (AutoLinearLayout) contentView.findViewById(R.id.QiTa);
        mBuXiangMai = (AutoLinearLayout) contentView.findViewById(R.id.mBuXiangMai);
        qiTaYuanYin = (AutoLinearLayout) contentView.findViewById(R.id.QiTaYuanYin);

        mCheckhoppingNotDelivery = (CheckBox) contentView.findViewById(R.id.mCheckhoppingNotDelivery);
        mCheckCaoZuoYouWu = (CheckBox) contentView.findViewById(R.id.mCheckCaoZuoYouWu);
        mCheckChongFu = (CheckBox) contentView.findViewById(R.id.mCheckChongFu);
        mCheckQiTa = (CheckBox) contentView.findViewById(R.id.mCheckQiTa);
        mCheckBuXiangMai = (CheckBox) contentView.findViewById(R.id.mCheckBuXiangMai);
        mCheckQiTaYuanYin = (CheckBox) contentView.findViewById(R.id.mCheckQiTaYuanYin);
        bottomDialog.setContentView(contentView);

        mNotSD = (TextView) contentView.findViewById(R.id.mNotSD);
        mCZYW = (TextView) contentView.findViewById(R.id.mCZYW);
        mCfxd = (TextView) contentView.findViewById(R.id.mCfxd);
        mQTPY = (TextView) contentView.findViewById(R.id.mQTPY);
        mbxm = (TextView) contentView.findViewById(R.id.mbxm);
        mQTYY = (TextView) contentView.findViewById(R.id.mQTYY);
        submit = (Button) contentView.findViewById(R.id.submit);

        ViewGroup.LayoutParams layoutParams = contentView.getLayoutParams();
        layoutParams.width = getResources().getDisplayMetrics().widthPixels;
        contentView.setLayoutParams(layoutParams);
        bottomDialog.getWindow().setGravity(Gravity.BOTTOM);
        bottomDialog.getWindow().setWindowAnimations(R.style.BottomDialog_Animation);
        bottomDialog.show();
        setOnClick();
    }
    //取消订单原因
    public void shoppingCloseAnAccount() {
        Map params = new TreeMap();
        String timestamp = String.valueOf(System.currentTimeMillis());
        String nonce = String.valueOf(new Random().nextInt());
        params.put("timestamp", timestamp);
        params.put("nonce", nonce);
        params.put("signLogin", SignUtil.signLogin(nonce, timestamp));
        params.put("loginId", String.valueOf(loginId1));
        params.put("sign", SignUtil.sign(params)); //这里也需要时完整的url
        BaseService.getInstance().simplePostRequest(AppConstancts.Net.canCleOrder, params, new CallBackListener() {
            @Override
            public void onStart() {
            }

            @Override
            public void onSuccess(Object result) {
                Log.e("onSuccess", result.toString());
                String string = (String) result;
                Gson gson = new Gson();
                CanCleIntentBean canCleIntentBean = gson.fromJson(string, CanCleIntentBean.class);
                if (canCleIntentBean.result.state.equals("1")) {
                    mNotSD.setText(canCleIntentBean.reason.get(0).reason);
                    mCZYW.setText(canCleIntentBean.reason.get(1).reason);
                    mCfxd.setText(canCleIntentBean.reason.get(2).reason);
                    mQTPY.setText(canCleIntentBean.reason.get(3).reason);
                    mbxm.setText(canCleIntentBean.reason.get(4).reason);
                    mQTYY.setText(canCleIntentBean.reason.get(5).reason);
                }
            }
            @Override
            public void onFail(Object result) {
                Log.e("zzz", "失败" + result.toString());
                System.out.print("失败");
            }
        });
    }
    private void setOnClick() {
        submit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                submitOrder(orderCode,String.valueOf(yuanyinNum));
            }
        });
        mCheckhoppingNotDelivery.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                yuanyinNum=1;
                //mCheckhoppingNotDelivery.setChecked(true);
                mCheckCaoZuoYouWu.setChecked(false);
                mCheckChongFu.setChecked(false);
                mCheckQiTa.setChecked(false);
                mCheckBuXiangMai.setChecked(false);
                mCheckQiTaYuanYin.setChecked(false);
            }
        });
        mCheckCaoZuoYouWu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                yuanyinNum=2;

                mCheckhoppingNotDelivery.setChecked(false);
                //mCheckCaoZuoYouWu.setChecked(false);
                mCheckChongFu.setChecked(false);
                mCheckQiTa.setChecked(false);
                mCheckBuXiangMai.setChecked(false);
                mCheckQiTaYuanYin.setChecked(false);
            }
        });
        mCheckChongFu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                yuanyinNum=3;

                mCheckhoppingNotDelivery.setChecked(false);
                mCheckCaoZuoYouWu.setChecked(false);
                //mCheckChongFu.setChecked(false);
                mCheckQiTa.setChecked(false);
                mCheckBuXiangMai.setChecked(false);
                mCheckQiTaYuanYin.setChecked(false);
            }
        });
        mCheckQiTa.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                yuanyinNum=4;

                mCheckhoppingNotDelivery.setChecked(false);
                mCheckCaoZuoYouWu.setChecked(false);
                mCheckChongFu.setChecked(false);
                //mCheckQiTa.setChecked(false);
                mCheckBuXiangMai.setChecked(false);
                mCheckQiTaYuanYin.setChecked(false);
            }
        });
        mCheckBuXiangMai.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                yuanyinNum=5;

                mCheckhoppingNotDelivery.setChecked(false);
                mCheckCaoZuoYouWu.setChecked(false);
                mCheckChongFu.setChecked(false);
                mCheckQiTa.setChecked(false);
                //mCheckBuXiangMai.setChecked(false);
                mCheckQiTaYuanYin.setChecked(false);
            }
        });
        mCheckQiTaYuanYin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                yuanyinNum=6;
                mCheckhoppingNotDelivery.setChecked(false);
                mCheckCaoZuoYouWu.setChecked(false);
                mCheckChongFu.setChecked(false);
                mCheckQiTa.setChecked(false);
                mCheckBuXiangMai.setChecked(false);
                //mCheckQiTaYuanYin.setChecked(false);
            }
        });


        mShoppingNotDelivery.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                yuanyinNum=1;

                mCheckhoppingNotDelivery.setChecked(true);
                mCheckCaoZuoYouWu.setChecked(false);
                mCheckChongFu.setChecked(false);
                mCheckQiTa.setChecked(false);
                mCheckBuXiangMai.setChecked(false);
                mCheckQiTaYuanYin.setChecked(false);
            }
        });
        mCheckCaoZuoYouWu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                yuanyinNum=2;

                mCheckhoppingNotDelivery.setChecked(false);
                mCheckCaoZuoYouWu.setChecked(true);
                mCheckChongFu.setChecked(false);
                mCheckQiTa.setChecked(false);
                mCheckBuXiangMai.setChecked(false);
                mCheckQiTaYuanYin.setChecked(false);
            }
        });
        mChongFu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                yuanyinNum=3;

                mCheckhoppingNotDelivery.setChecked(false);
                mCheckCaoZuoYouWu.setChecked(false);
                mCheckChongFu.setChecked(true);
                mCheckQiTa.setChecked(false);
                mCheckBuXiangMai.setChecked(false);
                mCheckQiTaYuanYin.setChecked(false);

            }
        });
        qiTa.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                yuanyinNum=4;

                mCheckhoppingNotDelivery.setChecked(false);
                mCheckCaoZuoYouWu.setChecked(false);
                mCheckChongFu.setChecked(false);
                mCheckQiTa.setChecked(true);
                mCheckBuXiangMai.setChecked(false);
                mCheckQiTaYuanYin.setChecked(false);

            }
        });
        mBuXiangMai.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                yuanyinNum=5;

                mCheckhoppingNotDelivery.setChecked(false);
                mCheckCaoZuoYouWu.setChecked(false);
                mCheckChongFu.setChecked(false);
                mCheckQiTa.setChecked(false);
                mCheckBuXiangMai.setChecked(true);
                mCheckQiTaYuanYin.setChecked(false);
            }
        });
        qiTaYuanYin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                yuanyinNum=6;
                mCheckhoppingNotDelivery.setChecked(false);
                mCheckCaoZuoYouWu.setChecked(false);
                mCheckChongFu.setChecked(false);
                mCheckQiTa.setChecked(false);
                mCheckBuXiangMai.setChecked(false);
                mCheckQiTaYuanYin.setChecked(true);
            }
        });
    }
    //沉浸式状态栏
    public void immerSion() {
        getWindow().requestFeature(Window.FEATURE_NO_TITLE);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            Window window = getWindow();
            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
                    | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(Color.TRANSPARENT);
            window.setNavigationBarColor(Color.BLACK);
        }
    }
    //提交取消订单的原因
    public void submitOrder(String orderCode,String id){
        Map params = new TreeMap();
        String timestamp = String.valueOf(System.currentTimeMillis());
        String nonce = String.valueOf(new Random().nextInt());
        params.put("timestamp", timestamp);
        params.put("nonce", nonce);
        params.put("orderCode",orderCode);
        params.put("id",id);
        params.put("signLogin", SignUtil.signLogin(nonce, timestamp));
        params.put("loginId", String.valueOf(loginId1));
        params.put("sign", SignUtil.sign(params)); //这里也需要时完整的url
        BaseService.getInstance().simplePostRequest(AppConstancts.Net.submitOrder, params, new CallBackListener() {
            @Override
            public void onStart() {}

            @Override
            public void onSuccess(Object result) {
                Log.e("onSuccess", result.toString());
                String string = (String) result;
                Gson gson = new Gson();
                CanCleIntentBean canCleIntentBean = gson.fromJson(string, CanCleIntentBean.class);
                if (canCleIntentBean.result.state.equals("1")) {
                    if (canCleIntentBean.reason!=null){
                        mNotSD.setText(canCleIntentBean.reason.get(0).reason);
                        mCZYW.setText(canCleIntentBean.reason.get(1).reason);
                        mCfxd.setText(canCleIntentBean.reason.get(2).reason);
                        mQTPY.setText(canCleIntentBean.reason.get(3).reason);
                        mbxm.setText(canCleIntentBean.reason.get(4).reason);
                        mQTYY.setText(canCleIntentBean.reason.get(5).reason);
                    }
                    bottomDialog.dismiss();
                }
                ToastUtils.showShort(OrderDetailsActivity.this,""+canCleIntentBean.result.message);
            }
            @Override
            public void onFail(Object result) {
                Log.e("zzz", "失败" + result.toString());
                System.out.print("失败");
            }
        });
    }
}
